#include "EntityFactory.h"

void EntityFactory::MakeEntity(string entityType, string controllerType, string ID){
	entityCollection.push_back(newEntity(entityType, controllerType));
	entityID.push_back(ID);
}

Entity *EntityFactory::newEntity(string eType, string cType){
	Controller *controller = controllerFactory.createController(cType);
	if(eType == "PLAYER")
		return new PlayerEntity(controller);
	else if(eType == "STANDARD")
		return new FreeEntity(controller);
	else if(eType == "ENEMY")
		return new EnemyEntity(controller);
}

Entity *EntityFactory::getEntity(string ID){

	for(int i = 0; i < entityID.size(); i++){
		if(entityID[i] == ID){
			return entityCollection[i];
		}
	}
	
}